$(function(){
	$.tbshare = {
		favor:function(tbshareid) {
			var url = "index.php?app=tbshare&ac=show&ts=favor",
				$favornum = $("#favornum"),
				$favorhint = $("#favorhint"),
				$favorbtn  = $("#favorbtn");
			$favorbtn.attr("disabled",true);
			$.post(url,{tbshareid:tbshareid},function(data){
				if(data == "success") {
					var num = parseInt($favornum.val()) || 0;
					$favornum.text(num + 1);
					$favorhint.html("操作成功").hide(2000);
				} else if(data == "error") {
					alert("出错了，请刷新后重新操作");
				} else {
					$favorhint.html(data).hide(2000);
				}
			});
		}
	}
});
